<!DOCTYPE html>
<html>

	<head>
		<title>jQuery WeUI</title>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

		<meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
">
		<link rel="stylesheet" href="js/1.0.8/iconfont.min.css">
		<link rel="stylesheet" href="css/weui.min.css">
		<link rel="stylesheet" href="css/jquery-weui.css">
		<link rel="stylesheet" href="css/demos.css">
		<link rel="stylesheet" href="css/dizhi.css" />
		<link rel="stylesheet" href="css/zhishi.css" />

		<style>

		</style>
	</head>

	<body>
		<div class="tou">
			<div><a href=""><i class="Hui-iconfont">&#xe67d</i></a></div>
			<div class="dd-div">
				<div class="ding-dan">送餐地址</div>
			</div>
		</div>
		<div class="weui-cells weui-cells_form">
			<div class="weui-cell">
				<div class="weui-cell__hd"><label for="name" class="weui-label" style="font-size: 0.8rem;">选择地址：</label></div>
				<div class="weui-cell__bd">
					<input class="weui-input" id="start" type="text" v-model="wherea" value="天津 天津市 西青区">
				</div>
			</div>
		</div>
		<div class="weui-cells weui-cells_form">
			<div class="weui-cell">
				<div class="weui-cell__hd"><label for="name" class="weui-label" style="font-size: 0.8rem;">详细地址：</label></div>
				<div class="input"><input type="text" v-model="whereb" placeholder="请输入详细地址"></div>
			</div>
		</div>
		<div class="xinbie">
			<!--<div class="xdiv-one">性别：</div>-->
			<div class="xdiv-two">
				<!--<div class="body" @click="change(1)" :class="{body:classname}">先生</div>-->
				<!--<div class="gilr" @click="change(2)" :class="{body:!classname}">女士</div>-->
			</div>
		</div>
		<div class="weui-cells weui-cells_form">
			<div class="weui-cell">
				<div class="weui-cell__hd"><label for="name" class="weui-label" style="font-size: 0.8rem;">联系方式：</label></div>
				<div class="input"><input type="text" placeholder="请输入手机号"></div>
			</div>
		</div>
		<div class="button-div" @click="xinxi">
			<input type="button" value="确认信息">
		</div>
		<script src="js/jquery-2.1.4.js"></script>
		<script src="js/fastclick.js"></script>
		<script src="js/jquery-weui.js"></script>
		<script src="js/city-picker.js"></script>
		<script type="text/javascript" src="../shouye/js/vue.js"></script>
		<script src="../shouye/js/av-min-2.1.2.js" type="text/javascript" charset="utf-8"></script>
		<script>
			var APP_ID = 'hMxRNdIevDj4IR3LHG0vJRNU-gzGzoHsz';
			var APP_KEY = 'e7oBIWOnxaDwD5yTBBRUdN4t';
			AV.init({
				appId: APP_ID,
				appKey: APP_KEY
			});
			$("#start").cityPicker({
				title: "选择地址",
				onChange: function(picker, values, displayValues) {
					console.log(values, displayValues);
				}
			});
			var myvue = new Vue({
				el: "body",
				data: {
					classname: true,
					wherea: "",
					whereb: "",
					userid: ""
				},
				methods: {
					change: function(e) {
						console.log(e)
						if (e == 1) {
							this.classname = true
						} else {
							this.classname = false
						}
					},
					xinxi: function() {
						console.log(1)
						var obj = myvue.wherea + "-" + myvue.whereb
						var currentUser = AV.User.current();
						if (currentUser) {
							// 跳转到首页
							console.log(currentUser.id)
							var query = new AV.Query('mywhere');
							// 声明类型
							var TodoFolder = AV.Object.extend('mywhere');
							// 新建对象
							var todoFolder = new TodoFolder();
							// 设置名称
							todoFolder.set('where', obj);
							todoFolder.set('userid', currentUser.id);
							// 设置优先级
							todoFolder.save().then(function(todo) {
								console.log(todo);
							}, function(error) {
								console.error(error);
							});
				}
				else {
					//currentUser 为空时，可打开用户注册界面…
				}
			}
			}
			})
		</script>
	</body>

</html>